/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kungkhies.mvc.kungkhie.top_form;

import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *
 * @author clayton
 */
@Controller
public class TopFormController
{
    @RequestMapping(value ={"/topform"}, method = RequestMethod.GET)
    public String showKungkhiePage(@RequestParam(value = "submit") String submit, Map<String, Object> model)
    {
        System.out.println("Submit: " + submit);
        if (submit.equals("Browse Kungkhies"))
        {
            return "browse";
        }
        else if (submit.equals("Download Kungkhie"))
        {
            return "download";
        }
        else if (submit.equals("Publish Kungkhie"))
        {
            return "redirect:upload";
        }
        else if (submit.equals("Popmax Kungkhies"))
        {
            return "popmax";
        }
        else
        {
            return "kungkho";
        }
    }
    
    @RequestMapping(value ={"/upload"}, method = RequestMethod.GET)
    public String showUploadPage(Map<String, Object> model)
    {
        return "upload";
    }
}
